<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      {{msg}}
      <ul v-for="(item,index) in msg">
        <li>{{item}}</li>
      </ul>
      <button @click="gogo">走一走</button>
    </div>
    <script src="./vue.js"></script>
    <script>
      const app = new Vue({
        el: "#app",
        data: {
          msg: ["帅哥", "美女", "程序员"],
        },
        methods: {
          gogo() {
            // let a = this.msg[1];
            // this.msg.splice(0, 1);
            // this.msg.push(a);
            if (this.msg.length > 0) {
              this.msg.push(this.msg.shift());
            }
          },
        },
      });
    </script>
  </body>
</html>
